<!--<?php
include_once PrintEot('left');
print <<<EOT
-->
<script type="text/javascript" language="JavaScript" src="js/global.js"></script>
<script type="text/javascript">
function tips(){
	if(showDialog('confirm','你确定要删除此经纪人吗?'),0){
		alert(1);
		return false;
	}else {
		alert(2);
		return true;
	}
}

function checkEmpty() {
	var checkNum = 0;
	var element = document.getElementsByName('uids[]');
	for (var i=0;i<element.length;i++) {
		if (element[i].checked == true) {
			checkNum += 1;
		}
	}

	if (checkNum == 0) {
		alert('请选择要操作的对象');
		return false;
	} else {
		return confirm('是否确认该操作？');
	}
}
</script>
<div class="nav3 mb10">
    <ul class="cc">
        <li $nav[manager]>
        	<a hidefocus="true" href="$basename&type=manager">经纪人管理</a>
        </li>
    </ul>
</div>
<h2 class="h1">搜索条件</h2>
<form action="{$basename}" method="post">
<div class="admin_table mb10">
	<table width="100%" cellspacing="0" cellpadding="0">
		<tr class="tr1">
			<td class="td1">用户名</td>
			<td class="td2"><input type="text" class="input input_wa" name="username" value="$username" /></td>
		</tr>
		<tr class="tr1">
			<td class="td1">姓名</td>
			<td class="td2"><input type="text" class="input input_wa" name="realname" value="$realname" /></td>
		</tr>
		<tr class="tr1">
			<td class="td1">经纪人组头衔</td>
			<td class="td2">
				<select class="select_wa" name="groupid">
					<option value="0" selected="">所有经纪人</option>
<!--
EOT;
foreach($brokerGroup as $value){
$selected = $value[groupid] == $groupid ? 'selected="selected"' : '';
print <<<EOT
-->
					<option value="{$value[groupid]}" $selected>$value[name]</option>
<!--
EOT;
}
print <<<EOT
-->
				</select>
			</td>
		</tr>
	</table>
</div>

<div class="mb10 tac">
<span class="btn">
<span>
<button onfocus="blur();" type="submit">查 找</button>
</span></span>
</div>
</form>
<form action="{$basename}&action=option" method="post" name="manager">
<input type="hidden" name="lastUrl" value="$lastUrl">
<h2 class="h1">
<span class="fl mr10">经纪人管理</span> 
<span class="linka fl">
<a href="$basename&action=add" class="btn_add"><i>添加</i></a>
</span>
<span class="fr">[共{$totalCount}条结果]</span>
</h2>
<div class="admin_table mb10">
	<table width="100%" cellspacing="0" cellpadding="0">
		<tr class="tr2">
			<td width="24">选择</td>
			<td width="75">用户名</td>
			<td width="65">姓名</td>
			<td width="65">是否激活</td>
			<td width="90">服务商圈</td>
			<td width="300">认证类型</td>
			<td>操作</td>
		</tr>
<!--
EOT;
if($count){
foreach($brokerList as $value){
$brokerplate = $value['plate'];
$plate = '';
foreach($brokerplate as $subvalue){
	$tmp = $plateField[$subvalue];
	$plate .= $plate ? ','.$tmp : $tmp;
}
$certify = '';
foreach($value['verifyinfo'] as $subvalue){
	if($subvalue['check']){
		$certify .= $certify ? ','.$subvalue['name'] : $subvalue['name'];
	}
}

$active = $value['ifactive'] ? '激活' : '锁定';
$activeStyle = $value['ifactive'] ? ' class=s3 ' : ' class=s1 ';
print <<<EOT
-->		
		<tr class="tr1">
			<td class="td2">
				<input type="checkbox" name="uids[]" value="{$value[uid]}"  />
			</td>
			<td class="td2">
				<a href="u.php?uid={$value[uid]}">{$value[username]}</a>
			</td>
			<td class="td2">
				<a href="index.php?m=house&q=shop&uid={$value[uid]}" target="_blank">{$value[realname]}</a>
			</td>
			<td class="td2">
				<span $activeStyle>{$active}</span>
			</td>
			<td class="td2">{$plate}</td>
			<td class="td2">$certify</td>
			<td class="td2">
			<a href="$basename&action=edit&uid=$value[uid]" class="mr20">[编辑]</a>
			<a href="$basename&action=option&optiontype=delete&uids[]=$value[uid]&groupid=$groupid&realname=$realname&username=$username&page=$page" onclick="return confirm('你确定要删除此经纪人吗？')" class="mr20">[删除]</a>
			</td>
		</tr>

<!--
EOT;
}
}else{
print <<<EOT
-->
<tr><td class="p10" colspan="9"><div class="admin_tips">啊哦，没有你要的信息！</div></td></tr>
<!--
EOT;
}
print <<<EOT
-->				
	</table>
	<br/>
	<div class="mb10 tac">
		<span><input type="radio" name="optiontype" id="c1" value="active" checked/><label for="c1">激活</label></span>&nbsp;&nbsp;&nbsp;
		<span><input type="radio" name="optiontype" id="c2" value="lock"/><label for="c2">锁定</label></span>&nbsp;&nbsp;&nbsp;
		<span><input type="radio" name="optiontype" id="c3" value="delete"/><label for="c3">删除</label></span>
	</div>
</div>
<div>
$pages
</div>
<br/>
<div class="mb10 tac">
	<span class="bt">
		<span>
			<button  onclick="CheckAll(document.manager);" type="button">全选</button>
		</span>
	</span>
    <span class="btn">
	    <span>
	   		 <button onclick="return checkEmpty()" onfocus="blur();" type="submit">提交</button>
	    </span>
    </span>
</div>

</form>
<!--
EOT;
include_once PrintEot('adminbottom');
?>-->